# encoding: utf-8
# Author    : limusen
# Datetime  : 2023/10/19 09:58
# File      : login_pages.py
# explain   : 文件说明
import time

from common.base import Base
from page_objects.locator import login_locator as lg


class LoginPages(Base):

    def open(self):
        self.open_url(lg.login_page_url)

    def login(self, kwargs):
        self.send_keys(lg.username, kwargs['username'])
        self.send_keys(lg.password, kwargs['password'])
        self.click(lg.remember_me)
        self.click(lg.login_button)

    def logins(self):
        pass


if __name__ == '__main__':
    from common.browse import Browser

    driver = Browser().get_driver()
    res = LoginPages(driver)
    res.open()
    info = {
        'username': 'nswe',
        'password': 111111
    }
    res.login(info)
    time.sleep(5)
    res.quit()
